package business.impl;

import java.util.List;

import model.TPractice;
import model.TRoleB;
import business.basic.iHibBaseDAO;
import business.basic.iHibBaseDAOImpl;
import business.dao.RoleDao;

public class RoleDaoImpl implements RoleDao {
	
	iHibBaseDAO bdao = null;
	public void setBdao (iHibBaseDAO bdao){
		this.bdao=bdao;
		
	}

	@Override
	public TRoleB getAtomById(int id) {
		TRoleB title = (TRoleB) bdao.findById(TRoleB.class,id);
		return title;
	}

	@Override
	public int addAtom(TRoleB model) {
		Object obj = bdao.insert(model);
		if (obj == null) {
			return 0;
		}
		return 1;
	}

	@Override
	public boolean upAtom(TRoleB model) {
		return bdao.update(model);
	}

	@Override
	public boolean delAtom(int id) {
		return bdao.delete(TRoleB.class, id);
	}

	@Override
	public List<TRoleB> getAtoms() {
		String sql = " from TRoleB ";
		List<TRoleB> modl = bdao.select(sql);
		return modl;
	}

}
